<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
/*
    function add(a, b) {
        return a + b;
    }
    var result = add(1, 4);
    document.write(result);*/

    var add = function (a, b) {
        return a + b;
    }
    //输出5
    /*var result = add(1, 4);
    document.write(result);*/

    //输出NaN
    var result1 = add(1);
    document.write(result1);

    //输出3
    /*var result2 = add(1,2,3);
    document.write(result2);*/

</script>
</body>
</html>